package br.edu.ufcg.lp2;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class SystemTest {
	
	System system;
	
	User user;
	
	Tag gender;
	
	Name a;
	Name b;
	Name c;
	
	Vote va;
	Vote vb;
	Vote vc;

	@Before
	public void setUp() throws Exception {
		// Creating a new system and its components
		user = new User("user");
		gender = new Tag("male or female");
		system = new System(user, gender);
		
		// Creating some names
		a = new Name("Abraao", "Nome com A");
		b = new Name("Barnabe", "Nome com B");
		c = new Name("Catarina", "Nome com C");
		
		// Creating votes
		va = new Vote(0, user);
		vb = new Vote(-1, user);
		vc = new Vote(1, user);
		
		// Adding votes to the names
		a.addVote(va);
		b.addVote(vb);
		c.addVote(vc);
		
		// Adding names to the system
		system.addName(c);
		system.addName(b);
		system.addName(a);
	}

	@Test
	public void testSystem() {
		// Normal case system created above
		// To Exception test cases, please refer to GameTest, UserTest and TagTest
	}

	@Test
	public void testGetNextId() {
		// Test GetNextId. It starts with "00001" and is incremented by one every time
		assertEquals("00001", system.getNextId());
		assertEquals("00002", system.getNextId());
		assertEquals("00003", system.getNextId());
		assertEquals("00004", system.getNextId());
		assertEquals("00005", system.getNextId());
		assertEquals("00006", system.getNextId());
		assertEquals("00007", system.getNextId());
		assertEquals("00008", system.getNextId());
		assertEquals("00009", system.getNextId());
		assertEquals("00010", system.getNextId());
	}

	@Test
	public void testGetNamesByAlfa() {
		// Names were not added in alphabetical order. Now testing if our method rearranges them
		// in said order
		assertEquals(true, system.getNamesByAlfa().get(0).equals(a));
		assertEquals(true, system.getNamesByAlfa().get(0).equals(b));
		assertEquals(true, system.getNamesByAlfa().get(0).equals(c));
		// Change to Treeset?
	}

	@Test
	public void testGetNamesByRating() {
		// Names were not added in rating order. Now testing if our method rearranges them in said order
		// Test for Treeset? Will this remain a Treeset, or will it change to List?
	}

	@Test
	public void testGetCurrentGame() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetCurrentUser() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetGender() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetRecommedations() {
		fail("Not yet implemented");
	}

	@Test
	public void testSaveGame() {
		fail("Not yet implemented");
	}

	@Test
	public void testLoadGame() {
		fail("Not yet implemented");
	}

	@Test
	public void testLike() {
		fail("Not yet implemented");
	}

	@Test
	public void testDislike() {
		fail("Not yet implemented");
	}

	@Test
	public void testHalflike() {
		fail("Not yet implemented");
	}

	@Test
	public void testAddUseToCurrentGame() {
		fail("Not yet implemented");
	}

	@Test
	public void testRemoveUseToCurrentGame() {
		fail("Not yet implemented");
	}

	@Test
	public void testAddName() {
		fail("Not yet implemented");
	}

	@Test
	public void testRemoveName() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetName() {
		fail("Not yet implemented");
	}

	@Test
	public void testFind() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetTags() {
		fail("Not yet implemented");
	}

}
